专利摘要:
Method for the selective tracing of program instructions that includes the steps of, given a program that has its pre-processed source files, its object files, and the symbol location file, selecting the sentences to trace along with the type trace to be performed for each statement, and obtain the content of an auxiliary memory consisting of trace codes and non-operation codes, where each trace code is aligned with the instruction that completes the execution of the selected statement, and a device configurable in "NOMINAL" mode, which interprets the auxiliary memory as error detection and correction codes, and "TRACE" mode, which performs parallel search, decoding and execution of program instructions and trace codes of auxiliary memory. (Machine-translation by Google Translate, not legally binding)
公开号:ES2802723A1
申请号:ES201930650
申请日:2019-07-12
公开日:2021-01-20
发明作者:Polo Oscar Rodríguez;Hellín Agustín Martínez;Espada Pablo Parra;Prieto Sebastián Sánchez;Tejedor Ignacio García;Silva Fariña Antonio Da
申请人:Universidad Politecnica de Madrid;Universidad de Alcala de Henares UAH;
IPC主号:
专利说明:

[0003] TECHNICAL SECTOR
[0005] The invention is framed, in general, in the Electronics, Informatics and Telecommunications (ICT) sector, although it has specific application in critical systems typical of the Aerospace, Automotive and high reliability sectors.
[0007] BACKGROUND OF THE INVENTION
[0009] Different inventions have been identified that propose solutions to facilitate the drawing of instructions.
[0011] Patent application US 5996092, "System and method for tracing program execution within a processor before and after a triggering event" allows to start and interrupt the trace of instructions, using a trace processor that works in parallel to the processor that executes the instructions themselves The trace processor, after detecting the start time of the trace by means of a specific instruction, stores in a shared memory information related to the entire sequence of instruction execution up to the moment in which it detects the trace stop instruction. So, to activate and deactivate the trace insert a specific instruction in the executable code.
[0013] Commercial tools such as RapiTime (G. Bernat et al., "Identifying Opportunities for Worst-case Execution Time Reduction in an Avionics System," Ada User Journal, Volume 28, Number 3, 2007, pp. 189-194), use certain techniques in order to characterize critical systems in the field of avionics, automotive, or space systems. They employ code instrumentation, inserting instructions that trigger the trace at previously selected points by analyzing the source files. Instrumentation, however, has the disadvantage of the overhead introduced at execution time due to the inserted instructions, and the consequent increase in the space occupied by the executable code.
[0015] With respect to patent application US 2017147472, "Systems and methods for a real time embedded trace", the main difference is that the system traces the jump instructions autonomously.
[0017] As already described, the identification of the execution moment of previously selected instructions is being used in critical systems and allows to draw blocks of code to evaluate their execution time in the worst case, taking into account that the transition between some of these blocks , like the one corresponding to an else block and the subsequent block, do not imply a jump in execution so they would not be detected by the solution presented by US2017147472.
[0019] As for patent US6513134, "System and method for tracing program execution within a superscalar processor", it presents an improvement compared to US 5996092, allowing it to work with superscalar processors that work at high frequencies, above 400MHz. an encoding of the information to be traced that allows reducing the space that must be used to store it in the trace buffer provided as output. As in this patent, blocks of instructions are traced to analyze their execution, but defining a more flexible way to trigger the trace and using trace encoding that allows savings in terms of stored information and the number of pins used. This patent, therefore, does not avoid the overload of the use of instrumentation techniques of code that affect the entire system, as is the case with the claimed invention, but seeks to optimize a tracing mechanism, not based on or in the instrumentation, but in the detection of events that conform to predefined conditions.
[0020] Finally, there is a patent application called "A METHOD AND A DEVICE FOR PROCESSING IN PARALLEL OF PROGRAM INSTRUCTIONS AND TRACE INSTRUCTIONS", with application number P201830266, pending approval, which differs significantly from the new invention presented. The problem they intend to solve is the same, in the application P201830266 the instrumentation of the code is facilitated by adding a specific trace instruction to the set of processor instructions, and a processor design capable of simultaneously decoding and executing an effective instruction and an instruction of trace, avoiding execution time overhead, but being intrusive with respect to the location of the code and the total space it occupies, since it requires its modification for the insertion of the trace instructions.
[0022] Therefore, it is concluded that many of the existing systems for trace instructions allow programming specific trace trigger events to collect trace information limited to a certain interval before and / or after said event. These methods, however, suffer from a certain rigidity in that the number of blocks that can be traced in each execution is always limited, and they do not adapt well to the code instrumentation techniques that are used in the characterization of the time of execution in the worst case in critical systems, such as the one used by the aforementioned RapiTime tool.
[0024] DESCRIPTION OF THE INVENTION
[0026] In a first aspect of the invention, a method is disclosed for generating the content of an auxiliary memory that, being aligned with the memory that stores the instructions of a program, is intended to store the information that enables the trace of a set of selected instructions of said program. This method consists of a three-step procedure: 1) From the pre-processed source files (that is, with all the macros expanded) of a program, the source code sentences to trace and the type of trace are selected for each statement. 2) After selection, the object files with debugging information for that program are used to locate automatically the relative memory address where the instruction corresponding to the execution of each selected sentence is stored. 3) Finally, using the symbol location file, and the information obtained in the two previous steps, the contents of the auxiliary memory aligned with the program memory is generated. This content locates in the absolute positions, which have been calculated from the symbol location file, and from the relative memory addresses obtained in step 2), the code of the type of trace chosen for each statement in step 1) , thus leaving the memory configured with the information that enables the trace of the selected sentences.
[0028] The second aspect of the invention is a configurable processing device capable of working in two modes called "TRACE" and NOMINAL.
[0030] In "NOMINAL" mode, the device reads and interprets the contents of the auxiliary memory as error detection and correction codes associated with the instructions stored in the program memory, correcting the instructions in the event that the fault is recoverable, or generating an exception if it is not.
[0032] In "TRACE" mode the device is capable of reading and interpreting the trace codes stored in the auxiliary memory, executing them in parallel with the instructions aligned to each code, resulting in the generation of trace information in an output register, Furthermore, this information is sufficient to uniquely identify the instruction drawn.
[0034] The invention is directly applicable to those architectures that use error detection and correction modules such as EDAC modules, although any architecture can be the object of the invention by enabling access to an auxiliary memory aligned with the program memory, so that with Each word in program memory will also capture the word in auxiliary memory that has the same offset.
[0036] The processing device configurable in “TRACE” mode and in “NOMINAL” mode, understands:
[0037] • an instruction search stage that, starting from the address of the next instruction to be executed, simultaneously reads an instruction from the program memory, and a word from the auxiliary memory aligned with the program memory. In "TRACE" mode, this stage generates a trace instruction through the composition of the trace code, and the address of the program memory, which allows the drawn instruction to be uniquely identified. In "NOMINAL" mode, the stage generates a program instruction valid, once the possible storage errors in memory have been corrected, or it generates an exception, in the event that the detected errors could not be corrected;
[0038] • a decoding stage comprising:
[0039] or a module for decoding a program instruction;
[0040] or a decoding module for a trace instruction (which only operates in "TRACE" mode).
[0041] • a pipeline of program instructions for processing only program instructions;
[0042] • a trace pipeline for processing trace instructions only (which only operates in "TRACE"mode);
[0043] • an output register for the trace (which only operates in "TRACE" mode);
[0044] • a data path that in turn comprises a set of multiplexers;
[0045] • a data path controller, which has an interface made up of a set of inputs, from elements of the different stages, and a set of outputs that control the multiplexers, as well as the load on the registers associated with the different stages and in the exit register for the trace;
[0047] where the data path controller is configured to determine, based on its own state and the value of the inputs in said controller, the value of the outputs that are sent to the data path multiplexers in such a way that, in "TRACE" mode, a trace instruction is executed in synchronization with the program instruction that has been read simultaneously, said execution being effective during the last stage of the trace pipeline .
[0048] In an embodiment of the invention, the processing device detects the insertion of a bubble in the step of decoding program instructions, which leads to the data path controller setting a path that in the next cycle loads a "0" as an inoperative trace instruction in the trace instruction decoding stage, this inoperative trace instruction being in parallel with the bubble inserted in the program instruction decoding stage.
[0050] In an embodiment of the invention, the processing device detects the insertion in the next cycle of a bubble in step 3 of the program instruction pipeline, which leads to the data path controller setting a path that in the next cycle load a "0" as inoperative trace instruction in stage 3 of trace instructions, leaving this inoperative trace instruction in parallel with the bubble inserted in stage 3 of program instructions.
[0052] In an embodiment of the invention, the processing device detects the insertion in the next cycle of a bubble in step 4 of the program instruction pipeline, which leads the data path controller to set a path that in the next cycle load a "0" as inoperative trace instruction in stage 4 of trace instructions, leaving this inoperative trace instruction in parallel with the bubble inserted in stage 4 of program instructions.
[0054] In an embodiment of the invention, the processing device detects the insertion in the next cycle of a bubble in step 5 of the program instruction pipeline, which leads to the data path controller setting a path that in the next cycle load a "0" as inoperative trace instruction in stage 5 of trace instructions, leaving this inoperative trace instruction in parallel with the bubble inserted in stage 5 of program instructions.
[0056] In an embodiment of the invention, the processing device uses a field of an internal control register to determine the configuration of its "TRACE" or "NOMINAL" working mode. In another embodiment of the invention, the device Processing uses the value assigned to an external signal of the device to configure the "TRACE" or "NOMINAL" working mode.
[0058] In a third aspect of the invention a processor is disclosed that comprises a device for searching, decoding and processing in parallel, and in a synchronized manner, program instructions and trace instructions according to any one of the previous embodiments for the first aspect of the invention.
[0060] In the present device, no use is made of a shared memory and the tracing mechanism is based on the execution of tracing codes stored in words of an auxiliary memory, and not on the execution of an instruction that activates and deactivates the trace by the processor itself. The method of the proposed invention allows to independently control the tracing of each instruction of the executable code since the trace codes are inserted in words that are aligned with the instructions of the executable code of which it is desired to obtain a specific trace. The method of the proposed invention defines a three-step procedure, which uses the source code, the object code, and the symbol location file of a program, to locate the positions of the words in the auxiliary memory in which to insert the trace information, without altering the executable code. The device proposed in this invention processes the trace information in parallel with the aligned instruction to be traced, which results in the writing in an output register of a unique identification word of the instruction that has been executed. An analysis hardware captures the identification word, so that the specific moment at which the drawn instruction was executed is recorded. In this way, the present invention does not establish intervals of instructions to be traced, but rather, by means of the selective control of the trace of instructions located in any part of the code, it allows to obtain the execution time in the worst case of each one of the system functions.
[0062] In the invention presented here, the instructions to be traced are defined by a method that allows, selectively, to insert the trace information into an auxiliary memory, and in a position aligned to the instruction we wish to trace. The The device presented in this invention processes the trace information in parallel and synchronized with the instruction to be traced.
[0064] The new invention defines a method that, from the source code, the object code, and the symbol location file of a program, and once the points of the source code to be plotted have been selected, the content of an auxiliary memory is determined, aligned with the memory that stores the code, so that the instructions to be drawn are marked. The new invention, therefore, does not modify the processor's instruction set and does not require inserting trace instructions to the code, so that including trace codes does not alter the executable code of the program to be traced. In addition, the new invention proposes the configuration of the processing device in two modes, one called TRAZA, where the information from the auxiliary memory is interpreted as trace codes that are executed in parallel, and the other NOMINAL, which uses the auxiliary memory to contain error detection and correction codes.
[0066] Given that the application of code instrumentation using current processors introduces overhead in the execution time, the presented invention, aimed at eliminating these overloads, provides an improvement with a specific objective framed in this area. The new invention avoids increasing the space occupied by the executable code, since the code is not instrumented to mark the instructions to be drawn, and the need to add new operation codes to the processor.
[0068] BRIEF DESCRIPTION OF THE FIGURES
[0070] To complement the description of the invention and with the aim of helping a better understanding of its characteristics, a set of drawings is attached as an integral part of said description, in which, with an illustrative and non-limiting nature, the following has been represented:
[0072] Figure 1. Method of automatic generation of the contents of an auxiliary memory, aligned with the program memory, containing the trace codes of those selected instructions to be plotted.
[0074] Figure 2. Structure of the device for the search, decoding and parallel execution of program instructions and trace instructions proposed in the invention. In figure 2 the elements of this device are referenced, which are the following:
[0076] 100 Instruction Search Stage 1
[0077] 101 Program memory containing the instructions to be read by the search stage
[0078] 102 Auxiliary memory containing the codes to be interpreted by the device
[0079] 103 Main module of the search stage
[0080] 104 Instruction read by the main module of the search stage 105 Code read by the main module of the search stage 106 Address of the instruction read by the main module of the search stage
[0081] 107 WAIT: Input to the controller of the data path that monitors the wait in the search for instructions of the main module of the search stage
[0082] 108 NR_ERROR: Input to the data path controller that monitors the detection of a non-recoverable error in the instruction read by the main module of the search stage
[0083] 109 Module for calculating the address of the instruction to be read in the search stage
[0084] 110 Input multiplexer to the register that stores the address of the next instruction to be searched by the search stage.
[0085] 111 Register containing the address of the instruction to be searched by the search stage
[0086] 112 LD_DIR: Signal that controls the storage in the register that contains the address of the next instruction to be searched by the search stage.
[0087] SEL_DIR: Output of the data path controller that controls the input multiplexer to the register that contains the address of the next instruction to be searched by the search stage.
[0088] Simultaneous decoding stage of a program instruction and a trace instruction
[0089] Stage 2 Program Instruction Decoding Module
[0090] Stage 2 trace instruction decoding module Program instruction loaded into stage 2 program instruction decoding module
[0091] Trace Instruction Loaded into Stage 2 Trace Instruction Decoding Module
[0092] Device data path driver
[0093] Inputs to the data path controller
[0094] Data path controller outputs
[0095] LD_INS: Data path controller output that controls the loading of stage 2 program instruction decoding module
[0096] LD_TRZ: Data path controller output that controls the loading of the stage 2 trace instruction decoding module
[0097] Stage 2 trace instruction decoding module input selection multiplexer
[0098] SEL_TE2: Data path controller output that controls the input multiplexer to the stage 2 trace instruction decoding module
[0099] Stage 3 of the program instructions pipeline
[0100] Trace Instructions Pipeline Stage 3
[0101] Stage 4 of the program instructions pipeline
[0102] Stage 4 of the trace instructions pipeline
[0103] Stage 5 of the program instructions pipeline
[0104] Stage 5 of the trace instructions pipeline
[0105] Pipeline of the program instructions
[0106] Pipeline from trace instructions
[0107] Trace information output record
[0108] TE5_DIRI_ES_0: Signal that monitors if the trace instruction pipeline stage 5 stores a zero value in the address field
[0109] LD_TR_OUT: Signal that controls the storage of trace information in the output register. It takes the value complementary to the TE5_DIRI_ES_0 signal, so the record is only loaded when the address field of the trace information is non-zero.
[0110] Trace Instruction Pipeline Stage 3 Input Selection Multiplexer
[0111] Trace Instruction Pipeline Stage 4 Input Selection Multiplexer
[0112] Trace Instruction Pipeline Stage 5 Input Selection Multiplexer
[0113] SEL_TE3: Data path controller output that controls the input multiplexer to stage 3 of the trace instruction pipeline
[0114] SEL_TE4: Controller output of the data path that controls the input multiplexer to stage 4 of the trace instruction pipeline
[0115] SEL_TE5: Output of the data path controller that controls the input multiplexer to stage 4 of the trace instruction pipeline
[0116] BUBBLE_E2: Input signal to the controller that monitors the insertion of a bubble in stage 2 of program instruction decoding
[0117] BUBBLE_E3: Input signal to the controller that monitors the inserting a bubble in program statement pipeline stage 3
[0118] 145 BUBBLE_E4: Input signal to the controller that monitors the insertion of a bubble in stage 4 of the program instructions pipeline
[0119] 146 BUBBLE_E5: Input signal to the controller that monitors the insertion of a bubble in stage 5 of the program instructions pipeline
[0120] 147 Trace information generated by the trace instruction pipeline after the execution of the trace instruction 148 Input to the calculation module of the address of the instruction to be read in the search stage corresponds to the jump address 149 Address field of the information obtained as a result of executing a trace instruction.
[0122] DESCRIPTION OF A FORM OF EMBODIMENT OF THE INVENTION
[0124] The realization of the invention will be based on the implementation of the method, described in figure 1, which allows obtaining the content of an auxiliary memory, formed by trace codes and non-operation codes, which enables the selective trace of a program stored in a program memory aligned with the auxiliary memory, as well as the construction of a device, described in figure 2, with two modes of operation, called "TRACE" and "NOMINAL", and that in its "TRACE" mode is capable of search, decode and execute the trace codes in parallel with the program instructions, without introducing any overhead in the program execution time, while in "NOMINAL" mode the device is able to interpret each word of the auxiliary memory aligned with an instruction in program memory, such as an error detection and correction code in the storage of that instruction.
[0126] The method and the device in its "TRACE" mode can be used to perform a hybrid program analysis. This analysis combines the static analysis of the program code, with information obtained during the execution of this program on the deployment platform, in order to infer program properties, such as the "worst case execution" time of each of the program functions. The static analysis determines which sentences It is necessary to trace and, by the method of selective tracing of program instructions described in the invention, the contents of the auxiliary memory containing the trace codes corresponding to the instructions selected for the trace are obtained.
[0128] The program instruction selective tracing method consists of a three-step procedure (1, 2, 3). To execute this procedure, the pre-processed source files (4) of the program, its object files with debugging information (5), and the symbol location file (6) obtained during linking (7) are required to generate the executable file (13). The process allows to obtain the content of an auxiliary memory (12), consisting of trace codes (17) and non-operation codes (18), aligned with the content of the program memory (13) where the instructions to be found draw.
[0130] The first step of the procedure (1) consists of selecting the sentences to be drawn on the pre-processed source files of the program (4), the elements that characterize each selected sentence (10) being: the name of the file source (15), the line number (8) of the statement within that file, and the type of trace (9) to be performed. The procedure allows different types of trace, the basic type being the one that only traces the moment of execution of the statement, while the rest of non-basic types allow tracing different elements of the internal state of the processor, such as, for example, the specific content of a record.
[0132] The second step of the procedure (2) consists of using the object files with program debug information (5) to automatically identify, and for each sentence selected (10) in the first step (1), the relative address (14 ) of the instruction to draw (11) that completes the execution of said sentence.
[0133] The third and last step of the procedure (3) uses, for each sentence selected (10) in the first step (1), the elements that characterize said selection, which are: file name (15), line number (8) and trace type (9). The information provided by these elements, together with the relative address (14), within the object file, of the instruction to trace (11) identified in the second step (2), is used to perform a search on the location file of symbols (6), and thus, to be able to automatically obtain the content of an auxiliary memory (12) that locates the trace codes (17) of each selected sentence (10) in the first step (1), being the offset (16) of each trace code (17) within the content of auxiliary memory (12) the same as that of the instruction to trace (11), identified in the second step of the procedure (2), within the content of the program memory (13). Those positions of the auxiliary memory that have the same offset as the instructions that have not been selected for the trace are completed with NOP non-operation codes (18), thus obtaining a content of the auxiliary memory (12) that keeps aligned the trace codes (17) of the sentences selected for trace (10), with the instructions to be traced (11) that complete those sentences, which form part of the content of the program memory (13).
[0135] The device proposed in the invention consists of an internal structure that allows searching, decoding and executing program instructions and trace instructions in parallel, so that the tracing of the instructions of a program is not intrusive neither at execution time nor at the location of the program in the program memory, since it is an auxiliary memory that is used to locate the trace codes. In this way, the storage address, the sequence and the time of execution of the instructions of the program under analysis are not modified by the introduction of the traces.
[0137] The main elements of the structure of the proposed device are the following: a search stage (100), which is formed by a module for calculating the address of the instruction (109) and a main module of the search stage (103) ; a decoding stage (114), having a program instruction decoding module (115) and a trace instruction decoding module (116); a pipeline for the program instructions (132); a specific pipeline for trace instructions (133); an output register (134), which receives the trace information obtained after the execution of the trace instructions; a data path, formed by a set of multiplexers (110,124,137,138,139); a controller of the data path of the device (119), which determines, based on its status and the value of its inputs (120), the value of the outputs (121) that control both the multiplexers (110,124,137,138,139) of the different stages, such as the load signals in registers associated with the different stages (111, 115, 116, 126, 127, 128, 129, 130, 131), as well as the output register (134). Both the inputs (120) and the outputs (121) are graphically represented in figure 2, together with the label assigned for each signal.
[0139] The processing device uses the search stage (100) to simultaneously load a program instruction (104) from program memory (101) and a code (105) from auxiliary memory (102), the code being aligned to instruction; which means that it has the same offset within the auxiliary memory (102) as the program instruction (104) within the program memory (101).
[0141] The processing device, in its NOMINAL mode, interprets the code (105) within the main module of the search stage (103) as an error detection and correction code, so that the program instruction (104) read from the program memory (101) can be corrected in the event of a recoverable error, and is delivered error-free in the next cycle as a valid program instruction (117) to the program instruction decoder (115) of the decoding step (114 ). In case the error is not recoverable, the main module (103) of the search stage (100) will activate a signal (108) that will be interpreted by the processor as an exception.
[0143] The processing device, in its "TRACE" mode, combines the code (105) read from the auxiliary memory (102) with the address (106) corresponding to the program instruction (104) read from the program memory (101) , in order to build a trace instruction (118) which in subsequent cycles is decoded and executed in parallel with program instruction (117).
[0145] In the "TRACE" mode of the processing device, the program instruction decoding module (115), corresponding to the decoding stage (114), decodes the program instruction (117) and, in parallel, the decoding module Trace instruction (116) decodes trace instruction (118), whose trace code was stored in auxiliary memory (102) in a position aligned with that held by program instruction (117) in program memory ( 101).
[0147] In the "TRACE" mode of the processing device, the controller of the route (119) uses the values of the signals "WAIT" (107), "BUBBLE_E2" (143), "BUBBLE_E3” (144), "BUBBLE_E4” ( 145), "BUBBLE_E5" (146) to determine the route that the trace instructions will follow to the next stages. The controller configures the multiplexers (124, 137, 138 and 139) of the route to ensure that a trace instruction is executed in synchronization with the aligned program instruction, said execution taking effect during the last stage (131) of the pipeline . trace (133), in which it is verified that the "TE5_DIR_ES_0" signal (135) is deactivated, in which case the "LD_TR_OUT" signal is activated (136) and the trace information is directed to the output register (134) .
[0149] The trace information stored in the output register (134) of the device can be analyzed by means of support hardware and a logic analyzer, so that it is possible to capture the moment of execution of the drawn program instructions, as well as the result of the execution of the trace instruction corresponding to the "TR" field (146) of the trace information. The trace information uniquely identifies the program instruction drawn thanks to the DIRI field (149) that was assigned in the search stage to the value of the address (106) of the program instruction (104) read.
[0151] In the "TRACE" mode of the processing device, the data path controller (119) will monitor the signal "BUBBLE_E2" (143) to detect the insertion of a bubble in the instruction decoding module (115) of the decoding stage (114), and will set the "SEL_TE2" signal (125) to the same value as the "BUBBLE_E2" signal (143), so that in case of inserting the bubble, the input multiplexer (124) to the trace instruction decoding module (116) of the decoding stage (114) routes a 0 as input to the trace instruction decoding module (116); If not, what is routed is the trace instruction formed by the code (105) and the address of the instruction to trace (106), coming from the main module (103) of the previous search stage (100).
[0153] In the "TRACE" mode of the processing device, the data path controller (119) will monitor the signal "BUBBLE_E3" (144) to detect the insertion of a bubble in stage 3 (126) of the instruction pipeline (132 ), and will set the "SEL_TE3" signal (140) to the same value as the "BUBBLE_E3" signal (144) so that, if the bubble is inserted, the input multiplexer (137) to stage 3 (127) of the trace pipeline (133) route a 0 as input to that stage (127); Otherwise, what is routed is the trace instruction (118) from the previous decoding stage (116).
[0155] In the "TRACE" mode of the processing device, the data path controller (119) will monitor the signal "BUBBLE_E4" (145) to detect the insertion of a bubble in stage 4 (128) of the instruction pipeline (132 ) and will set the "SEL_TE4" signal (141) to the same value as the "BUBBLE_E4" signal (145), so that, in the event of inserting the bubble, the input multiplexer (138) to stage 4 (129) of the trace pipeline (133), route a 0 as input to that stage (129); and otherwise, what is routed to stage 4 (129) is the output from the previous stage (127).
[0157] In the "TRACE" mode of the processing device, the data path controller (119) will monitor the signal "BUBBLE_E5" (146) to detect the insertion of a bubble in step 5 (130) of the instruction pipeline (132 ) and will set the "SEL_TE5" signal (142) to the same value as the "BUBBLE_E5" signal (146), so that, in case the bubble is inserted, the input multiplexer (139) to stage 5 (131) of the trace pipeline (133), route a 0 to the DIRI field (149) of that stage (131); and if not, what is Route to stage 5 (131) is the output from the previous stage (129).
[0159] The processing device, regardless of whether it is configured in "TRACE" mode, or in "NOMINAL" mode, if a jump instruction becomes effective in a stage of the instruction pipeline (132), it will insert in the next cycle a bubble both in that stage and in the previous stages of the instruction pipeline (132), and will set the signal "SEL_DIR" (113) to 0, so that the address calculation module (109) takes the value of the effective address of jump located in NEXT_PC (148).
[0161] The processing device, regardless of whether it is configured in "TRACE" or "NOMINAL" mode, in the event that its search stage (100) detects that the instruction addressed in the program memory (101), whose address it is provided by the "DIR" register (111), it is not available in a single cycle and one or more waiting cycles are required to complete the reading, it will activate the "WAIT" signal as many cycles as the waiting cycles require the reading; each waiting cycle requiring the insertion of a bubble in the decoding step (114).
[0163] The preferred physical embodiment will have on the one hand a "Software" part, corresponding to the program that performs the method of obtaining the contents of the auxiliary memory described in figure 1, and another part of the "Hardware / Firmware" implementation of the described functionality of the processing device represented in figure 2, starting from a description model of a standard processor architecture that uses an auxiliary memory module for the detection and correction of errors on which the aforementioned modifications will be made, which basically affect the the possibility of working in two modes; one called "NOMINAL", which interprets the contents of the auxiliary memory as error detection and correction codes, and another, called "TRACE", which by modifying the design of the search and decoding stages, and incorporating the pipeline trace, enables the search, decoding and parallel execution of the program instructions with the trace codes stored in the auxiliary memory, calculated using the "Software" that implements the method of obtaining the contents of the auxiliary memory described in the figure 1. Said models of Description of architectures will allow to generate the manufacturing details of the device, which can be materialized on a programmable device such as an FPGA ( Field Programmable Gate Array) or on an Application Specific Integrated Circuit (ASIC, Application Specific Integrated Circuit).
[0165] There are different realization options. All of them are based on the VHDL model of an “IP Core” of a segmented processor, such as ARM, LEON or RISC V, on which the implementation of the device pipeline structure will be modified to include the functionality described in this patent. The objective is to generate a new "IP Core", which can be manufactured on FPGA or ASIC.
[0167] In the "TRACE" type working mode, the search stage (100) simultaneously reads a program instruction (104) from the program memory (101) and a code (105) from the auxiliary memory (102), and performs in the main module (103) of the search stage (100) the combination of the code (105) read from the auxiliary memory (102) with the address (106) corresponding to the program instruction (104) read from the memory program (101), to construct a trace instruction (118) that in the following cycles is decoded and executed in parallel and synchronously with the program instruction (117), using a trace instruction pipeline (133) that generates as a result of the execution a result value TR (147) that will be stored in the last stage "TE5" of the pipeline of trace instructions (133);
[0168] wherein the processing device in its "TRACE" mode employs a trace instruction decoder (116) present in the decoding stage (114), which feeds the trace instruction pipeline (133);
[0169] where the data path controller (119), the processing device being in TRACE mode, and in the event that the trace instruction decoder (116) detects a non-operation code "NOP" in the trace instruction (118), sets the data path of the trace instructions pipeline (133) so that its stage "TE3" (127) receives a 0 and does not load a valid trace instruction, putting a value 1 in the signal "SEL_TE3" (140) that controls the multiplexer (137);
[0170] where the trace instruction pipeline (133), the processing device being In TRACE mode, it stores in its last stage "TE5" (131) the trace information obtained after executing a trace instruction (116), this information being formed by the address of the program instruction "DIRI" (149) that is executed in parallel and the data obtained after the execution of the trace instruction "TR" (147). In the event that a valid trace instruction had not been executed in parallel with the program instruction, the value of the field "DIRI" (149) stored in "TE5" (131) will be equal to 0;
[0171] where the trace instruction pipeline (133), while the processing device is in TRAZA mode, loads that information into the output register (134) whenever the field "DIRI" (149) is stored in "TE5" (131 ) is different from 0, according to the value of the signal "TE_DIRI_ES_0"(135);
[0172] where the data path controller (119), the processing device being in TRAZA mode, and in the case of detecting the activation of the "BUBBLE_E2" signal (143), which corresponds to the insertion of a bubble in the module of program instructions decoding (115), sets to 1 the selection signal "SEL_TE2" of the input multiplexer (124) to the decoding module of the trace instruction (116), and thus, and in parallel to the bubble inserted into the program instruction decoding module (115), a non-operating trace instruction is loaded into the trace instruction decoding module (116);
[0173] where the data path controller (119), the processing device being in TRACE mode and in the case of detecting the activation of the "BUBBLE_E3" signal (144), which corresponds to the insertion of a bubble in stage 3 , "E3" (126) of the program instruction pipeline (132), sets the selection signal "SEL_TE3" (140) of the input multiplexer (137) to stage 3 to 1, "TE3" (127), of the trace instruction pipeline (133); and in this way, and in parallel to the bubble inserted in stage 3, "E3" (126), of the pipeline of program instructions (132), a non-operating trace instruction is loaded in stage 3, "TE3" (127), from the trace instruction pipeline (133);
[0174] where the data path controller (119), the processing device being in TRACE mode and in the case of detecting the activation of the "BUBBLE_E4" signal (145) corresponding to the insertion of a bubble in step 4, "E4" (128), from the program instruction pipeline (132), sets the selection signal "SEL_TE4" (141) of the input multiplexer (138) to stage 4, "TE4" (129), of the trace instruction pipeline (133); and thus, and in parallel to the bubble inserted in stage 4, "E4" (128 ), from the program instruction pipeline (132), a non-operating trace instruction is loaded in step 4, "TE4" (129), from the trace instruction pipeline (133);
[0175] where the data path controller (119), the processing device being in TRACE mode and in the case of detecting the activation of the "BUBBLE_E5" signal (146) corresponding to the insertion of a bubble in step 5, "E5" (130), from the program instruction pipeline (132), sets the selection signal "SEL_TE5" (142) of the input multiplexer (139) to stage 5 to 1, "TE5" (131), from the trace instruction pipeline (133); and thus, and in parallel to the bubble inserted in stage 5, "E5" (130), of the program instruction pipeline (132), a non-operating trace instruction is loaded in stage 5, "TE5" (131), from the trace instructions pipeline (133).
权利要求:
Claims (12)
[1]
1. select the sentences to be drawn on the program's pre-processed source files (4), the elements that characterize each sentence being: the name of the source file (15), the line number (8) of the sentence within that file, and the type of trace (9), basic if it only traces the moment of execution of the sentence or not basic if it also traces the value of some element of the internal state of the processor, which is intended to be carried out;
2. automatically identify, for each selected statement (10), the relative address (14) of the instruction to trace (11) that completes the execution of said statement, using the object files with program debugging information (5) ;
3. Automatically obtain the content of an auxiliary memory (12), which includes trace codes (17) and non-operation codes (18), using the elements that characterize each selected sentence (10), the relative address ( 14) identified within the file object of the instruction to trace that corresponds to the selected sentence (10), and the information of the symbol location file (6), obtained during the linking (7) of the files object of the program ( 5) that generates the executable file (13); in order to obtain, for each selected sentence (10), the trace code (17) and its movement within the auxiliary memory that stores it, the trace codes (17) being aligned with the instructions to be drawn (11) of the content of the program memory (13); where aligned means that the offset (16) of each trace code (17) within the content of auxiliary memory (12) is the same as that of the instruction to trace (11) within the content of program memory (13 ), and those positions of the auxiliary memory that have the same offset as the program instructions that have not been selected for the trace they are completed with NOP (18) non-operation codes.
[2]
2. - A processing device capable of performing the search, decoding and parallel execution of program instructions and trace codes obtained from the method of claim 1, comprising two working modes "TRACE" and NOMINAL, characterized in that understands:
• a search stage (100), which in turn comprises:
or a module for calculating the address of the instruction (109),
or a main search module (103), capable of simultaneously reading an instruction (104) from the program memory (101) and a code (105) from an auxiliary memory (102),
• a decoding stage (114) which in turn comprises:
or a program instruction decoding module (115), or a trace instruction decoding module (116),
• a pipeline of program instructions (132),
• a pipeline of trace instructions (133),
• an output register (134) that receives the trace information obtained after the execution of a trace instruction,
• a data path comprising a set of multiplexers (110,124,137,138,139),
• a data path controller, which has a set of inputs (120), formed by the signals (107, 108, 135, 143, 144, 145, 146) calculated in the different stages, and generates a set of outputs (121), which control the multiplexers (110,124,137,138,139) and the load in the registers associated with the different stages (111, 115, 126, 127, 128, 129, 130, 131), as well as the load in the output register ( 134) of the trace information obtained after executing a trace instruction,
[3]
3. - The processing device according to claim 2, wherein in the "NOMINAL" type of work mode, the search stage (100) simultaneously reads a program instruction (104) from the program memory (101) and a code (105) of the auxiliary memory (102), and interprets said code (105) within the main module of the search stage (103) as an error detection and correction code; so that instruction (104) read from program memory (101) can be corrected, in the event of a recoverable error, and delivered error-free in a subsequent cycle as a valid program instruction (117) to the instruction decoder of program (115) of the decoding stage (114) and, in case the error is not recoverable, the main module (103) of the search stage (100) activates a signal (108) that is interpreted by the processor as an exception.
[4]
4. - The processing device according to claim 2, wherein, in the "TRACE" type of work mode, the search stage (100) simultaneously reads a program instruction (104) from the program memory (101) and a code (105) from the auxiliary memory (102), and perform in the main module (103) of the search stage (100) the combination of the code (105) read from the auxiliary memory (102) with the address ( 106) corresponding to the program instruction (104) read from the program memory (101), to construct a trace instruction (118) that in the following cycles is decoded and executed in parallel and synchronously with the program instruction (117), using a pipeline of trace instructions (133) that generates as a result of the execution a result value (TR, 147) that will be stored in the last stage (TE5) of the pipeline of trace instructions (133) ; and uses the trace instruction decoding module (116), present in the decoding stage (114), which feeds the trace instruction pipeline (133).
[5]
5. - The processing device according to claim 4, wherein the data path controller (119), in the event that the trace instructions decoder (116) detects a non-operation code "NOP" in the trace instruction (118), sets the data path of the trace instruction pipeline (133) so that its stage "TE3" (127) receives a 0 and does not load a valid trace instruction, setting a value for this 1 in the “SEL_TE3” signal (140) that controls the multiplexer (137).
[6]
6. - The processing device according to claim 5, wherein the pipeline of trace instructions (133), stores in its last stage "TE5" (131) the trace information obtained after the execution of a trace instruction (116), this information being formed by the address of the program instruction "DIRI ”(149) that is executed in parallel and the data obtained after executing the trace instruction" TR "(147), and in the event that a valid trace instruction had not been executed in parallel with the program instruction , the value of the field "DIRI" (149) stored in "TE5" (131) is equal to 0.
[7]
7. - The processing device according to claim 6, where the trace instruction pipeline (133) loads that information into the output register (134) whenever the field "DIRI" (149) stored in "TE5 ”(131) is different from 0, according to the value of the signal" TE_DIRI_ES_0 "(135).
[8]
8. - The processing device according to claim 7, where the data path controller (119), in the case of detecting the activation of the "BUBBLE_E2" signal (143), which corresponds to the insertion of a bubble in the program instruction decoding module (115), sets the "SEL_TE2" selection signal from the input multiplexer (124) to the trace instruction decoding module (116) to 1, and so on, and In parallel to the bubble inserted into the program instruction decoding module (115), a non-operating trace instruction is loaded into the trace instruction decoding module (116).
[9]
9. - The processing device according to claim 8, wherein the data path controller (119), the processing device being in TRACE mode and in the case of detecting the activation of the "BUBBLE_E3" signal (144 ), which corresponds to the insertion of a bubble in stage 3, "E3" (126) of the program instruction pipeline (132), sets the selection signal "SEL_TE3" (140) of the input multiplexer (137 ) to step 3, "TE3" (127), of the trace instruction pipeline (133); and in this way, and in parallel to the bubble inserted in step 3, "E3" (126), of the program instruction pipeline (132), a non-operant trace instruction is loaded in step 3, "TE3" (127), of the trace instruction pipeline (133);
[10]
10. - The processing device according to claim 9, wherein the data path controller (119), the processing device being in TRACE mode and in the case of detecting the activation of the "BUBBLE_E4" signal (145 ) which corresponds to the insertion of a bubble in stage 4, "E4" (128), of the program instruction pipeline (132), sets the selection signal "SEL_TE4" (141) of the input multiplexer (138) to 1 ) to step 4, "TE4" (129), of the trace instruction pipeline (133); and in this way, and in parallel to the bubble inserted in stage 4, "E4" (128), of the program instruction pipeline (132), a non-operating trace instruction is loaded in stage 4, "TE4" (129), from the trace instructions pipeline (133);
[11]
11. - The processing device according to claim 10, wherein the data path controller (119), the processing device being in TRACE mode and in the case of detecting the activation of the "BUBBLE_E5" signal (146 ) which corresponds to the insertion of a bubble in stage 5, "E5" (130), of the program instruction pipeline (132), sets the selection signal "SEL_TE5" (142) of the input multiplexer (139 ) to step 5, "TE5" (131), of the trace instructions pipeline (133); and thus, and in parallel to the bubble inserted in stage 5, "E5" (130), of the program instruction pipeline (132), a non-operating trace instruction is loaded in stage 5, "TE5" (131), from the trace instructions pipeline (133).
[12]
12. - A processor characterized in that it comprises a processing device capable of working in two modes, which we call "TRACE" mode and "NOMINAL" mode according to any of the preceding claims,
where in "NOMINAL" mode it uses an auxiliary memory, whose words are read in parallel with the program instructions, and are used as error detection and correction codes for the program instructions.
where in "TRACE" mode the same auxiliary memory is used to store codes which enable the trace of the program instructions, and which are read and executed in parallel with the program instructions according to any of the preceding claims.
类似技术:
公开号 | 公开日 | 专利标题
US8001432B2|2011-08-16|Uninitialized memory detection using error correction codes and built-in self test
US8370810B2|2013-02-05|Debugging device and debugging method
US9647693B2|2017-05-09|Data processing apparatus
RU2429525C2|2011-09-20|Debugging scheme comparing processor instruction set processing mode
US20080109594A1|2008-05-08|Non-volatile memory device controlled by a micro-controller
EP2686772B1|2018-11-28|Diagnosing code using single step execution
JP2008009721A|2008-01-17|Evaluation system and evaluation method thereof
US10199108B2|2019-02-05|Methods for read retries and apparatuses using the same
ES2802723B2|2021-07-27|A METHOD FOR SELECTIVE TRACING OF INSTRUCTION EXECUTION, RELATED PROCESSING DEVICE AND PROCESSOR
US20060036803A1|2006-02-16|Non-volatile memory device controlled by a micro-controller
ES2697548A1|2019-01-24|A METHOD AND A PROCESSING DEVICE IN PARALLEL OF PROGRAM INSTRUCTIONS AND TRAIL INSTRUCTIONS |
US8468327B2|2013-06-18|Processor test apparatus, processor test method, and processor test program
CN105446843A|2016-03-30|SOC chip function test system and method
JP2013257640A|2013-12-26|Configuration controller, configuration control method and configuration control program
EP2660713A1|2013-11-06|Patch mechanism in embedded controller for memory access
US10319459B1|2019-06-11|Customizable built-in self-test testplans for memory units
KR20130126513A|2013-11-20|Signal processing circuit and testing apparatus using the same
JP2007058450A|2007-03-08|Semiconductor integrated circuit
CN107045606B|2020-04-10|Method and apparatus for monitoring execution of program code
JP5850732B2|2016-02-03|Semiconductor device and control method thereof
KR20200088760A|2020-07-23|Checksum generation
JP2020153867A|2020-09-24|Semiconductor device, method for diagnosing semiconductor device, and diagnostic program of semiconductor device
JP2008226020A|2008-09-25|Register verifying device, method and program
Sanchez et al.2011|On the functional test of branch prediction units based on the branch history table architecture
KR100807936B1|2008-02-28|Method for booting dual processor board accompanying to memory test
同族专利:
公开号 | 公开日
WO2021009398A1|2021-01-21|
ES2802723B2|2021-07-27|
引用文献:
公开号 | 申请日 | 公开日 | 申请人 | 专利标题
US5996092A|1996-12-05|1999-11-30|International Business Machines Corporation|System and method for tracing program execution within a processor before and after a triggering event|
US20090287907A1|2008-04-28|2009-11-19|Robert Graham Isherwood|System for providing trace data in a data processor having a pipelined architecture|
US9507598B1|2015-12-15|2016-11-29|International Business Machines Corporation|Auxiliary branch prediction with usefulness tracking|
ES2697548A1|2018-03-20|2019-01-24|Univ Madrid Politecnica|A METHOD AND A PROCESSING DEVICE IN PARALLEL OF PROGRAM INSTRUCTIONS AND TRAIL INSTRUCTIONS |
US6513134B1|1999-09-15|2003-01-28|International Business Machines Corporation|System and method for tracing program execution within a superscalar processor|
US10795802B2|2015-11-19|2020-10-06|Honeywell International Inc.|Systems and methods for a real time embedded trace|
法律状态:
2021-01-20| BA2A| Patent application published|Ref document number: 2802723 Country of ref document: ES Kind code of ref document: A1 Effective date: 20210120 |
2021-07-27| FG2A| Definitive protection|Ref document number: 2802723 Country of ref document: ES Kind code of ref document: B2 Effective date: 20210727 |
优先权:
申请号 | 申请日 | 专利标题
ES201930650A|ES2802723B2|2019-07-12|2019-07-12|A METHOD FOR SELECTIVE TRACING OF INSTRUCTION EXECUTION, RELATED PROCESSING DEVICE AND PROCESSOR|ES201930650A| ES2802723B2|2019-07-12|2019-07-12|A METHOD FOR SELECTIVE TRACING OF INSTRUCTION EXECUTION, RELATED PROCESSING DEVICE AND PROCESSOR|
PCT/ES2020/070437| WO2021009398A1|2019-07-12|2020-07-08|Method for the selective tracing of the execution of instructions, related processing device and processor|
[返回顶部]